import openpyxl
import os
from openpyxl.drawing.image import Image



if os.path.exists('./test.xlsx'):
    print('---exists')
    wb = openpyxl.load_workbook('./test.xlsx')
    print('wb', wb)
else:
    print('===not exists')
    wb = openpyxl.workbook()

ws = wb['Sheet1']
img = Image('./icon.png')
img.width = 110
img.height = 100

ws.add_image(img, 'B1')
wb.save('./test.xlsx')
wb.close()
